﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Globalization;

namespace JXT.PrimaryKey.Batman.Core.Configuration
{
    /// <summary>
    /// 系统Service端配置Section
    /// </summary>
    public class ServiceConfigurationSection : ConfigurationSection
    {
        /// <summary>
        /// 数据库连接配置
        /// </summary>
        [ConfigurationProperty("connectionSetting")]
        public ServiceConnectionSettingConfigurationElementCollection ConnectionSetting
        {
            get { return this["connectionSetting"] as ServiceConnectionSettingConfigurationElementCollection; }
            set { this["connectionSetting"] = value; }
        }

        /// <summary>
        /// Memcached配置
        /// </summary>
        [ConfigurationProperty("memcachedSetting")]
        public MemcachedSettingConfigurationElementCollection MemcachedSetting
        {
            get { return this["memcachedSetting"] as MemcachedSettingConfigurationElementCollection; }
            set { this["memcachedSetting"] = value; }
        }

        /// <summary>
        /// 交易所配置
        /// </summary>
        [ConfigurationProperty("exchangeSetting")]
        public ExchangeSettingConfigurationElementCollection ExchangeSetting
        {
            get { return this["exchangeSetting"] as ExchangeSettingConfigurationElementCollection; }
            set { this["exchangeSetting"] = value; }
        }

        /// <summary>
        /// OAuth配置
        /// </summary>
        [ConfigurationProperty("oauthSetting")]
        public OauthSettingConfigurationElementCollection OauthSetting
        {
            get { return this["oauthSetting"] as OauthSettingConfigurationElementCollection; }
            set { this["oauthSetting"] = value; }
        }

        /// <summary>
        /// 多语言配置
        /// </summary>
        [ConfigurationProperty("language", IsRequired = true)]
        public CultureInfo Language
        {
            get { return this["language"] as CultureInfo; }
            set { this["language"] = value; }
        }

        /// <summary>
        /// 虚拟交易所配置
        /// </summary>
        [ConfigurationProperty("virtualExchangeSetting")]
        public VirtualExchangeConfigurationElement VirtualExchangeSetting
        {
            get { return this["virtualExchangeSetting"] as VirtualExchangeConfigurationElement; }
            set { this["virtualExchangeSetting"] = value; }
        }

        /// <summary>
        /// 后台行情服务节点服务Uri
        /// </summary>
        [ConfigurationProperty("quotationServiceUri", IsRequired = false)]
        public string QuotationServiceUri
        {
            get { return this["quotationServiceUri"] as string; }
            set { this["quotationServiceUri"] = value; }
        }
    }
}
